#include    "sheetsprite_control.h"

void SheetSpriteControl::quest(int uid,void* data)
{
    switch(uid)
    {
    case RENDER:
        m_sprite->render();
        break;
    case UPDATE:
        m_sprite->update(*(float*)data);
        break;
    case KEYDOWN_J:
        {
            m_sprite->setAction(SheetSprite::ACTION::ATTACK);
        }
        break;
    case KEYDOWN_A:
        {
            m_sprite->setToward(false);
            m_sprite->setAction(SheetSprite::ACTION::RUN);
        }
        break;
    case KEYDOWN_D:
        {
            m_sprite->setToward(true);
            m_sprite->setAction(SheetSprite::ACTION::RUN);
        }
        break;
    case KEYDOWN_SPACE:
        {
            m_sprite->setAction(SheetSprite::ACTION::JUMP);
        }
        break;
    default:
        m_sprite->setAction(SheetSprite::ACTION::IDLE);
        break;
    }
}
